<extend name="Public/common"/>
<block name="h_link">
  <link rel="stylesheet" href="{$theme_path}/css/style.css?20181206_123"/>
  <link rel="stylesheet" href="{$theme_path}/css/animate.min.css"/>
  <link rel="stylesheet" href="{$theme_path}/css/slick.css"/>
  <link rel="stylesheet" href="{$theme_path}/css/cloud-zoom.css"/>
  <script src="{$theme_path}/js/jquery-1.8.3.min.js"></script>
  <script src="{$theme_path}/js/basic.js"></script>
  <script src="{$theme_path}/js/slick.min.js"></script>
  <script src="{$theme_path}/js/cloud-zoom.1.0.2.min.js"></script>
  <script src="__PUBLIC__/common/validate/jquery.validate-1.13.1.js"></script>
  <script src="__PUBLIC__/common/layer/layer.js?v=20182145212"></script>
  <!--[if lt IE 9]>
    <script src="{$theme_path}/js/html5.js"></script>
    <![endif]-->
  
</block>
<block name="othercss"></block>
<block name="body">
<div class="mian">
  <div class="pro">
    <div class="box">
      <div class="loc clearfix">
        <div class="sl">共 {$total_goods} 件相关商品</div>
        <i class="icon iconloc"></i>您现在在这里：<a href="{:U('/')}">百宝库</a> > {$goods.cat_name} <span>&gt;</span> <a> {$goods.goods_name}</a> </div>
      <div class="clearfix">
        <div class="proDetails clearfix">
          <div class="clearfix" style="
    border-bottom: 1px solid #dddddd;">
            <div class="left">
              <dl id="pro">
                <dd class="on">
                  <ul class="left1" id="lv1">
                    <foreach name="goods.arr_picture_list" item="pic" >
                      <li> <a class="cloud-zoom" href="__ROOT__{$pic}"
                                               rel="softFocus: false, position:'anypos1', smoothMove:1"><img
                                                    src="__ROOT__{$pic}"
                                                    alt=""/> </a> </li>
                    </foreach>
                    <foreach name="arr_par" item="par">
                      <if condition="$par['name'] eq '颜色'">
                        <foreach name="par.sub" item="arr_par_sub" key="k">
                          <li class="probig1" id="p{$k}"> <a class="cloud-zoom" href="__ROOT__{$goods.goods_id|get_pro_color_pic=$arr_par_sub}" rel="softFocus: false, position:'anypos1', smoothMove:1"><img src="__ROOT__{$goods.goods_id|get_pro_color_pic=$arr_par_sub}" alt=""/> </a> </li>
                        </foreach>
                      </if>
                    </foreach>
                  </ul>
                  <div class="zoom-desc" style="border-width:1px;position:relative">
                    <div id="anypos1" class="any"
                                             style="border-width:1px;position:absolute;top:-420px; left:0px;width:420px; height:420px;"></div>
                  </div>
                  <div class="left2-wrapper">
                    <div class="left2 clearfix" id="lu1">
                      <foreach name="goods.arr_picture_list" item="pic" >
                        <div class="ons"><img src="__ROOT__{$pic}" width="70" height="70"/></div>
                      </foreach>
                    </div>
                  </div>
                  <script>
                                        $(function(){
                                            $('.left2>div').hover(function(){
                                                $('.left2>div').removeClass('ons');
                                                $(this).addClass('ons');
                                                var indexs=$(this).index();
                                                $('.left1 li').css('opacity','0');
                                                if(!$('.left1 li').eq(indexs).hasClass('probig1')){
                                                    $('.left1 li').eq(indexs).css('opacity','1');
                                                }
                                            })
                                            $('#color a').click(function(){
                                                $('.proDetails .left2>div').removeClass('ons');
                                                var index=$(this).index();
                                                $('.left1 li').css('opacity','0');
                                                $('.left1 li#p'+index).css('opacity','1');
                                            })
                                        });
                                    </script> 
                </dd>
              </dl>
              <div class="share"> <a><img src="{$theme_path}/images/car2.png" width="25" height="25"/>分享 </a> 
			  <a  onclick="add_fav()" id="goods_fav"><img src="{$theme_path}/images/car3{:$isfav>0?'_2':''}.png" width="25" height="25"/>收藏商品 </a> </div>
            </div>
            <div class="right">
              <div class="h1">{$goods.goods_name}</div>
              <div class="h2">{$goods.cuxiao_msg}</div>
              <ul class="pick">
                <li class="clearfix">
                  <div class="h3">促销价</div>
                  <div class="h4">¥
                    <label id="data_price">{$goods.price}</label>
                  </div>
                </li>
                <li class="clearfix">
                  <div class="h3">原价</div>
                  <div class="h5">¥
                    <label id="data_price_market">{$goods.price_market}</label>
                  </div>
                </li>
              </ul>
              <foreach name="arr_par" item="par">
                <if condition="$par['name'] eq '颜色'">
                  <div class="clearfix">
                    <div class="h3">{$par.name}</div>
                    <div class="h4" id="colors"> <span class="pro_option spec spec_list" id="spec_list_{$par.id}" attr_t="{$par.name}">
                      <foreach name="par.sub" item="arr_par_sub">
                        <if condition="$arr_sel[$par['id']] eq $arr_par_sub"> <a href="javascript:void(0)"  class="sel"  onclick="select_spec(this)" attr_val="{$arr_par_sub}" attr_id="{$par.id}" title="{$arr_par_sub}" >
						<img src="__ROOT__{$goods.goods_id|get_pro_color_pic=$arr_par_sub}" width="60" height="60"/></a>
                          <else />
                          <a href="javascript:void(0)" onclick="select_spec(this)" attr_val="{$arr_par_sub}" attr_id="{$par.id}"  title="{$arr_par_sub}"  ><img src="__ROOT__{$goods.goods_id|get_pro_color_pic=$arr_par_sub}" width="60" height="60"/></a> </if>
                      </foreach>
                      </span> </div>
                  </div>
                  <script type="text/javascript">
                                        $(function(){
                                            $('.left2>div').hover(function(){
                                                $('.left2>div').removeClass('ons');
                                                $(this).addClass('ons');
                                                var indexs=$(this).index();
                                                $('.left1 li').css('opacity','0');
                                                if(!$('.left1 li').eq(indexs).hasClass('probig1')){
                                                    $('.left1 li').eq(indexs).css('opacity','1');
                                                }
                                            })
                                            $('#colors a').click(function(){
												
                                                $('.proDetails .left2>div').removeClass('ons');
                                                var index=$(this).index();
                                                $('.left1 li').css('opacity','0');
                                                $('.left1 li#p'+index).css('opacity','1');
                                            })
                                        });
                                    </script>
                  <else/>
                  <div class="clearfix others">
                    <div class="h3">{$par.name}</div>
                    <div class="h4 lists"> <span class="pro_option spec spec_list" id="spec_list_{$par.id}" attr_t="{$par.name}">
                      <foreach name="par.sub" item="arr_par_sub">
                        <if condition="$arr_sel[$par['id']] eq $arr_par_sub"> <a href="javascript:void(0)"  class="sel"  onclick="select_spec(this)" attr_val="{$arr_par_sub}" attr_id="{$par.id}" >{$arr_par_sub}</a>
                          <else/>
                          <a href="javascript:void(0)" onclick="select_spec(this)" attr_val="{$arr_par_sub}" attr_id="{$par.id}" >{$arr_par_sub}</a> </if>
                      </foreach>
                      </span> </div>
                  </div>
                </if>
              </foreach>
              <input type="hidden" name="goods_id" id="goods_id" value="{$goods.goods_id}" />
              <input type="hidden" name="count_arr_par" id="count_arr_par" value="{$arr_par|count}" />
              <input type="hidden" name="item_id" id="item_id" value="{$item_id}" />
              <input type="hidden" name="hide_store_num" id="hide_store_num" value="{$goods.store_num}" />
              <div class="clearfix h6-list">
                <div class="h6">销量<span style="color: #dd2727">{$sell_num}</span></div>
                <div class="h6">累计评价<span style="color: #dd2727">{$count_comment}</span></div>
                <div class="h6">积分<span style="color: #dd2727">{$goods.point}</span></div>
              </div>
              <div class="clearfix">
                <div class="h3">数量</div>
                <div class="h4 on">
                  <div class="number-add clearfix"> <i  id="btn_jian_num">-</i>
                    <input id="num" name="num"  value="1" type="text" class="num"/>
                    <i id="btn_jia_num">+</i> </div>
                  库存<span id="data_store_num">{$goods.store_num}</span>件 </div>
              </div>
              <div class="hrefs clearfix"><a class="on" onclick="add_cart()"><img src="{$theme_path}/images/car.png" width="25" height="25"/> 加入购物车</a> <a onclick="check_cart()">立即购买</a> </div>
            </div>
            <script>
                            $(function (e) {
                                $('.h4 a').click(function () {
                                    $(this).parents('.h4').children('a').removeClass('on');
                                    $(this).addClass('on');
                                })

                            })


                        </script> 
          </div>
          <div class="clearfix cool">
            <div class="pro-right pro-right1">
              <div class="title">百宝库热销</div>
              <ul id="slick1">
                <foreach name="hot_list" item="hot_item">
                  <li> <a href="{:U('Goods/index',array('id'=>$hot_item['goods_id']))}" target="_blank"> <img src="__ROOT__{$hot_item.picture}" alt="{$hot_item.goods_name}"/>
                    <div class="price">￥{$hot_item.price}</div>
                    </a> </li>
                </foreach>
              </ul>
              <script>
                                $('#slick1').slick({
                                    vertical: true,
                                    slidesToShow: 4,
                                    pauseOnHover: false
                                });
                            </script> 
            </div>
            <div class="right-cool"><a name="3"></a>
              <ul class="cool-xxk">
                <li> <a>商品详情</a></li>
                <li> <a>累计评价</a></li>
              </ul>
              <ul class="cool-xxk2">
                <li>
                  <div class="prod-table"> {$goods.detail2|htmldecode} </div>
                  <div class="editor"> {$goods.detail|htmldecode} </div>
                </li>
                <li style="background-color: #f4f4f4">
                  <div class="ljpj">累计评价 （{$count_comment}）</div>
                  <!--liuyan-->
                  <div class="liuyansum">
                    <ul>
                      <volist name="comment_list" id="item">
                        <li class="clearfix">
                          <div class="lans">
                            <div class="h1">{$item.member_name}</div>
                            <div class="h2">{$item.create_time|stringtime=3}</div>
                            <div class="h3">{$item.detail|trim_textarea}</div>
                            <if condition="$item['reply_detail'] neq ''">
                              <div class="h4"> 回复：{$item.reply_detail|trim_textarea} </div>
                            </if>
                          </div>
                          <div class="imgs"><img src="__ROOT__{$item.headpic}" width="80" height="80"/> </div>
                        </li>
                      </volist>
                    </ul>
                  </div>
                  <div class="pagetion"> {$comment_page}</div>
                </li>
              </ul>
            </div>
          </div>
        </div>
        <div class="pro-right">
          <div class="title">看了又看</div>
          <ul id="slick">
            <foreach name="history_list" item="history_item">
              <li> <a href="{:U('Goods/index',array('id'=>$history_item['goods_id']))}" target="_blank"> <img src="__ROOT__{$history_item.picture}" alt="{$history_item.goods_name}"/>
                <div class="price">￥{$history_item.price}</div>
                </a> </li>
            </foreach>
          </ul>
        </div>
      </div>
    </div>
  </div>
</div>
<include file="Public:right"/> 
<!--end  top-->
</block>
<block name="otherjs"> 
  <script>
    $(function () {
	  <if condition="$p gt 0">
	  $('.cool-xxk li').eq(1).addClass('on');
      $('.cool-xxk2 li').eq(1).show();
	  <else/>
      $('.cool-xxk li').eq(0).addClass('on');
      $('.cool-xxk2 li').eq(0).show();
	   </if>
       $('.cool-xxk li').click(function () {
       $('.cool-xxk>li').removeClass('on');
      $(this).addClass('on')
      var i = $(this).index();
      $('.cool-xxk2>li').hide()
       $('.cool-xxk2 li').eq(i).show();
        })
         })
      $('#slick').slick({
         vertical: true,
         slidesToShow: 4,
         pauseOnHover: false
       });
     </script>
  <link rel="stylesheet" type="text/css" href="__PUBLIC__/common/artDialog6/css/ui-dialog.css" />
  <script type="text/javascript" src="__PUBLIC__/common/artDialog6/dist/dialog-min.js"></script> 
  <script type="text/javascript">
            var goods_id = $("#goods_id").val();//商品ID
            var url_get_item = "{:U('Goods/get_item')}";//获取商品单件
            var url_add_cart = "{:U('Cart/add_cart')}";//加入购物车地址
            var url_add_fav = "{:U('Goods/add_fav')}";//商品收藏地址           
        </script> 
  <script type="text/javascript" src="{$theme_path}/js/jdMarquee.js"></script> 
  <script type="text/javascript" src="{$theme_path}/js/jqueryzoom.js"></script> 
  <script type="text/javascript" src="{$theme_path}/js/goods.js?20181220_2"></script> 
</block>
